/*
package com.wwy.monitor.config;

import com.alibaba.buc.acl.api.input.check.CheckActionsParam;
import com.alibaba.buc.acl.api.service.AccessControlService;
import com.alibaba.buc.acl.api.service.DataAccessControlService;
import com.alibaba.buc.acl.api.service.GrantService;
import com.alibaba.buc.api.ActionService;
import com.alibaba.buc.api.MenuService;
import com.alibaba.buc.api.PermissionService;

import com.aliexpress.boot.hsf.HsfProperties;
import com.wwy.monitor.service.acl.AclInfo;
import com.taobao.hsf.app.api.util.HSFApiConsumerBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(HsfProperties.class)
public class AclConfig {
    @Value("${spring.acl.hsf.version}")
    private String aclVersion;
    @Value("${spring.hsf.group}")
    private String group;
    @Value("${spring.hsf.timeout}")
    private int timeout;
    @Value("${spring.acl.access-key}")
    private String accessKey;
    @Value("${spring.authenticate.disable:false}")
    private boolean disableAuthenticate;

    @ConfigurationProperties(prefix = "spring.acl")
    @Bean
    public AclInfo createAclInfo() {
        return new AclInfo();
    }

    @Bean
    public CheckActionsParam createAclParam(){
        CheckActionsParam checkActionsParam = new CheckActionsParam();
        checkActionsParam.setAccessKey(accessKey);
        return checkActionsParam;
    }

    @Bean
    public AccessControlService createAccessControlService() throws Exception {
        if (disableAuthenticate) {
            return null;
        }
        HSFApiConsumerBean bean = new HSFApiConsumerBean();
        bean.setInterfaceName("com.alibaba.buc.acl.api.service.AccessControlService");
        bean.setVersion(aclVersion);
        bean.setGroup(group);
        bean.setClientTimeout(timeout);
        bean.init(true);
        return (AccessControlService) bean.getObject();
    }

    @Bean
    public ActionService createActionService() throws Exception {
        if (disableAuthenticate) {
            return null;
        }
        HSFApiConsumerBean bean = new HSFApiConsumerBean();
        bean.setInterfaceName("com.alibaba.buc.api.ActionService");
        bean.setVersion(aclVersion);
        bean.setGroup(group);
        bean.setClientTimeout(timeout);
        bean.init(true);
        return (ActionService) bean.getObject();
    }

    @Bean
    public PermissionService createPermissionService() throws Exception {
        if (disableAuthenticate) {
            return null;
        }
        HSFApiConsumerBean bean = new HSFApiConsumerBean();
        bean.setInterfaceName("com.alibaba.buc.api.PermissionService");
        bean.setVersion(aclVersion);
        bean.setGroup(group);
        bean.setClientTimeout(timeout);
        bean.init(true);
        return (PermissionService) bean.getObject();
    }

    @Bean
    public MenuService createMenuService() throws Exception {
        if (disableAuthenticate) {
            return null;
        }
        HSFApiConsumerBean bean = new HSFApiConsumerBean();
        bean.setInterfaceName("com.alibaba.buc.api.MenuService");
        bean.setVersion(aclVersion);
        bean.setGroup(group);
        bean.setClientTimeout(timeout);
        bean.init(true);
        return (MenuService) bean.getObject();
    }

    @Bean
    public DataAccessControlService createDataAccessControlService() throws Exception{
        HSFApiConsumerBean bean = new HSFApiConsumerBean();
        bean.setInterfaceName("com.alibaba.buc.acl.api.service.DataAccessControlService");
        bean.setVersion(aclVersion);
        bean.setGroup(group);
        bean.setClientTimeout(timeout);
        bean.init(true);
        return (DataAccessControlService) bean.getObject();
    }
    @Bean
    public GrantService createGrantService() throws Exception{
        HSFApiConsumerBean bean = new HSFApiConsumerBean();
        bean.setInterfaceName("com.alibaba.buc.acl.api.service.GrantService");
        bean.setVersion(aclVersion);
        bean.setGroup(group);
        bean.setClientTimeout(timeout);
        bean.init(true);
        return (GrantService) bean.getObject();
    }
}
*/
